#!/bin/bash
cd $(dirname $(readlink -f "$0"))
# echo Asia/Shanghai > /etc/timezone
#image=openjdk:jre
image=gitea.dev.ng8877.com/java/spring-gateway
#image=cimg/openjdk:8.0
name=gateway
port=$1
# 更新
#docker pull $image
# 删除
docker rm -f $name$1
# 运行
docker run -d \
    --restart=always \
    --net=host \
    -v /etc/timezone:/etc/timezone:ro \
    -v /etc/localtime:/etc/localtime:ro \
    -m 1G \
    --name=$name$1 \
    -e PORT=$port \
    -e SPRING_PROFILES='dev' \
    $image